package twelve;

import static util.Print.print;

/**
 * Created by 佳文 on 2016/11/4.
 * 自定义错误类型
 */
class SimpleException extends Exception{}
public class lesson1 {
    public void f() throws SimpleException{
        print("Throw SimpleException from f()");
        throw new SimpleException();
    }
    public static void main(String[] args){
        lesson1 sed = new lesson1();
        try{
            sed.f();
        }catch (SimpleException e){
            print("Caught it !");
        }
    }
}
